define(['app'],function(app){return {module: function($scope, $http, eventBusService, httpService, params) {

	//查询主校区和分校区
	httpService.post(app.urls.unit_selectSchoolAndAttach,{"fk_unit":"self"},function(data){
		if("0000" === data.code){
			$scope.unitList = data.data;
		}else{
			alert(data.msg);
		}
	});

	$scope.saveForm = function(){
		if($scope.formCheck()){

			httpService.post(app.urls.building_insert,$scope.form,function(data){
				if("0000" === data.code){
					eventBusService.publish("content.page.reload", data);
					eventBusService.publish("modal.page.close", {});
	    		}else{
	    			alert(data.msg);
	    		}
			});
		}
	}
}}});